home *** CD-ROM | disk | FTP | other *** search
- on(press){
- if(getProperty("/frog/fline", _currentframe) < "2")
- {
- if(getProperty("/head", _currentframe) == "1")
- {
- mouse_x = getProperty("/pos", _X);
- mouse_y = getProperty("/pos", _Y);
- s_x = "67.3";
- s_y = "156.8";
- call("catch");
- x_dist = mouse_x - s_x;
- y_dist = mouse_y - s_y;
- input = y_dist * y_dist + x_dist * x_dist;
- call("sqroot");
- tongLength = tongLength;
- pi = "3.1416";
- deltax = getProperty("/pos", _X) - getProperty("/start", _X);
- deltay = getProperty("/pos", _Y) - getProperty("/start", _Y);
- ratio = deltay / deltax;
- if("0" < deltax)
- {
- if("1" < ratio)
- {
- input = "1" / ratio;
- call("arctan");
- angle = "90" - output * "180" / pi;
- }
- else if("0" < ratio and ratio < "1")
- {
- input = ratio;
- call("arctan");
- angle = output * "180" / "3.14";
- }
- else if(ratio < "0" and - "1" < ratio)
- {
- input = ratio;
- call("arctan");
- angle = "360" + output * "180" / "3.14";
- }
- else if(ratio < - "1")
- {
- input = "1" / ratio;
- call("arctan");
- angle = "270" - output * "180" / pi;
- }
- }
- else if(deltax < "0")
- {
- if("1" < ratio)
- {
- input = "1" / ratio;
- call("arctan");
- angle = "270" - output * "180" / pi;
- }
- else if("0" < ratio and ratio < "1")
- {
- input = ratio;
- call("arctan");
- angle = "180" + output * "180" / "3.14";
- }
- else if(ratio < "0" and - "1" < ratio)
- {
- input = ratio;
- call("arctan");
- angle = "180" + output * "180" / "3.14";
- }
- else if(ratio < - "1")
- {
- input = "1" / ratio;
- call("arctan");
- angle = "90" - output * "180" / pi;
- }
- }
- else if(deltax == "0")
- {
- if("0" < deltay)
- {
- angle = "90";
- }
- else if(deltay < "0")
- {
- angle = - "90";
- }
- else if(deltay == "0")
- {
- angle = "null";
- }
- }
- setProperty("/dline", _rotation, angle);
- set("/dline:tongLength",tongLength);
- tellTarget("/dline")
- {
- gotoAndPlay(1);
- }
- }
- }
- }
-